package org.vsb.chmireader.hibernate.entity;

import java.io.Serializable;

import javax.persistence.Embeddable;


@Embeddable
public class ChmiRecordKey implements Serializable{
	
	/**
	 * 
	 */
	private static final long serialVersionUID = -4966351432123537568L;
	/**
	 * In what interwal it was saved
	 */
	private String dateAndTime;
	
	/**
	 * Station name
	 */
	private String stationName;

	public String getDateAndTime() {
		return dateAndTime;
	}

	public void setDateAndTime(String dateAndTime) {
		this.dateAndTime = dateAndTime;
	}

	public String getStationName() {
		return stationName;
	}

	public void setStationName(String stationName) {
		this.stationName = stationName;
	}

	@Override
	public int hashCode() {
		final int prime = 31;
		int result = 1;
		result = prime * result
				+ ((dateAndTime == null) ? 0 : dateAndTime.hashCode());
		result = prime * result
				+ ((stationName == null) ? 0 : stationName.hashCode());
		return result;
	}

	@Override
	public boolean equals(Object obj) {
		if (this == obj)
			return true;
		if (obj == null)
			return false;
		if (getClass() != obj.getClass())
			return false;
		ChmiRecordKey other = (ChmiRecordKey) obj;
		if (dateAndTime == null) {
			if (other.dateAndTime != null)
				return false;
		} else if (!dateAndTime.equals(other.dateAndTime))
			return false;
		if (stationName == null) {
			if (other.stationName != null)
				return false;
		} else if (!stationName.equals(other.stationName))
			return false;
		return true;
	}
	
	

}
